<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
div {
	width: 100px;
	height: 100px;
	border: 1px solid red;
}

body {
	/* 去掉body自带8个像素的外边距 */
	margin: 0;
}
#d1{
 /* margin-top: 50px;
  margin-left: 50px;
  margin-bottom: 50px;
  margin-right: 50px;*/
 /* margin: 50px;  四个方向都为50px  */
 /*margin: 50px 100px;   上下50 左右100*/
 /*margin: 0 auto;  居中*/
 /*上右下左  顺时针*/
 margin: 10px 20px 30px 40px;
}
#d2{
margin: 50px 0 0 50px;
}
</style>
</head>
<body>
  <div id="d1">div1</div>
  <div id="d2">div2</div>
  <div>div3</div>
</body>
</html>